package com.opengw.configuration.dao;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.opengw.configuration.publish.BasePublish;

@Repository("publishDAO")
public class PublishDAO {
	
	@Autowired
	private SessionFactory sessionFactory;
	
	@Transactional(propagation=Propagation.REQUIRED)
	public void savePublish(BasePublish publish){
		
		Session session = sessionFactory.getCurrentSession();
		
		session.save(publish);
		
	}
	
	
	
}
